/*
 *  This file is part of "SchoolChoice",
 *  a school registration system.
 *
 *  Copyright (C) 2009 Nicolas Decerf, Olivier Jacquemin.
 *
 *  "SchoolChoice" is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  "SchoolChoice" is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program: see the file COPYING.txt.  If not, see
 *  http://www.gnu.org/licenses/.
 */

/*
 * View class.
 *
 * Parent for classes of objects that display data
 * and optionally control edition of the same data.
 */

/*global SchoolChoice */

(function() {
     // Private static data.

     // Shortcut notation.
     var WAC = SchoolChoice.WebAppClient;

     // Private static methods.


     // Class and constructor declaration.
     WAC.View = function() { };

     // Prototype: public instance properties and methods.
     WAC.View.prototype = {
         /*
          * URL of the HTML page with the layout of this View object.
          * Should be set by the constructor of the descendant class.
          */
         _url: "",

         // Identifier of the container for all elements of this View.
         _rootElementId: "",

         // Loads the layout into the current page, at the element provided.
         load: function(rootElementId) {
             this._rootElementId = rootElementId;
             if (this._url) {
                 $("#" + rootElementId).load(this._url);
             }
         }
     };

     // Public static methods
 }) ();
